import http from "@/http"
import type { Announcement } from "./anTable"

//管理员获取公告方法
export const adGetAnnouncesApi = (page:number,pageSize:number,searchQuery?:string,status?:string)=>{
    return http.get("/api/announcement/adgetforms",{ page, pageSize, searchQuery ,status})
}
//发布公告
export const addAnnouncementApi  = (parm:Announcement)=>{
    return http.post("/api/announcement/addannouncement",parm)
}
//修改公告
export const editAnnouncementApi = (parm:Announcement)=>{
    return http.post("/api/announcement/editannouncement",parm)
}
//删除公告
export const deleteAnnouncementApi =(announcementId:string)=>{
    return http.delete(`/api/announcement/deleteAnnounc/${announcementId}`)
}

//用户获取公告
export const adGetAnnouncListApi = ()=>{
    return http.get("/api/announcement/getAnnounceList")
}

